package cn.tedu.vehicle_rental.order.controller;

import cn.tedu.vehicle_rental.basic.JsonResult;
import cn.tedu.vehicle_rental.order.pojo.dto.OrderSelectDto;
import cn.tedu.vehicle_rental.order.pojo.param.OrderParam;
import cn.tedu.vehicle_rental.order.pojo.vo.OrderSelectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/order")
@Api(tags = "订单模块")
public class OrderController {
    /**
     * 添加订单
     * @param orderParam
     * @return
     */
    @PostMapping("insert")
    @ApiOperation("添加订单")
    public JsonResult addOrder(@RequestBody OrderParam orderParam) {
        return JsonResult.ok("添加成功");
    }

    /**
     * 查询订单信息
     * @param orderSelectDto
     * @return
     */
    @GetMapping("select")
    @ApiOperation("查询订单")
    public JsonResult select(@RequestBody OrderSelectDto orderSelectDto) {
        OrderSelectVo orderSelectVo = new OrderSelectVo();
        return JsonResult.ok(orderSelectVo);
    }

    /**
     * 修改订单信息
     * @param orderId
     * @return
     */
    @PostMapping("update/{orderId}")
    @ApiOperation("修改订单")
    public JsonResult update(Integer orderId){
        return JsonResult.ok("修改成功");
    }
}
